<!doctype html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Factorialize a Number</title>
  <link rel="stylesheet" href="app.css">
</head>

<body>
  <div id="view"></div>
</body>

</html>
<script>
  function factorialize(num) {
    // 请把你的代码写在这里
    var number = 1;
    for (var i = 1; i <= num; i++) {
      number = number * i;
    }
    return number;
  }

  var str = factorialize(0);
  document.getElementById("view").innerHTML = str;
  console.log(str);
</script>